/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package newcrunch.grader;

import javax.swing.*;

/**
 *
 * @author ccadm
 */
public class SelectionPanel extends javax.swing.JPanel {    
    /**
     * Creates new form SelectionPanel
     */
//    private RightPanel rightPanel;
    
    public SelectionPanel() {
        initComponents();
        loadingProgress.setVisible(false);
    }
    
    public JProgressBar getLoadingBar()
    {
        return loadingProgress;
    }
    
    public JComboBox getCourseCombo()
    {
        return courseCombo;
    }
    
    public JComboBox getTaskCombo()
    {
        return taskCombo;
    }
    
    public JLabel getGroupLabel()
    {
        return groupLabel;
    }
    
    public JComboBox getGroupCombo()
    {
        return groupCombo;
    }
    
    public JProgressBar getLoadingProgress()
    {
        return loadingProgress;
    }
    
    public JPopupMenu getPopupMenu()
    {
        return popupMenu;
    }
    
    public JMenuItem getSignOutMenuItem()
    {
        return signOut;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        popupMenu = new javax.swing.JPopupMenu();
        signOut = new javax.swing.JMenuItem();
        jLabel1 = new javax.swing.JLabel();
        courseCombo = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        taskCombo = new javax.swing.JComboBox();
        loadingProgress = new javax.swing.JProgressBar();
        groupLabel = new javax.swing.JLabel();
        groupCombo = new javax.swing.JComboBox();

        signOut.setMnemonic(java.awt.event.KeyEvent.VK_S);
        signOut.setText("Sign Out");
        signOut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                signOutActionPerformed(evt);
            }
        });
        popupMenu.add(signOut);

        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                formMouseClicked(evt);
            }
        });

        jLabel1.setText("Select Course:");

        courseCombo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                courseComboItemStateChanged(evt);
            }
        });

        jLabel2.setText("Select Task:");

        taskCombo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                taskComboItemStateChanged(evt);
            }
        });

        loadingProgress.setIndeterminate(true);
        loadingProgress.setString("Loading...");
        loadingProgress.setStringPainted(true);

        groupLabel.setText("Select Group:");

        groupCombo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                groupComboItemStateChanged(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(courseCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(taskCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(groupCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(groupLabel)
                            .addComponent(loadingProgress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(courseCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(groupLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(groupCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(taskCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(loadingProgress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void courseComboItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_courseComboItemStateChanged
        //migrated to AuthManager
    }//GEN-LAST:event_courseComboItemStateChanged

    private void taskComboItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_taskComboItemStateChanged
        //migrated to AuthManager
    }//GEN-LAST:event_taskComboItemStateChanged

    private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked
        //migrated to AuthManager
    }//GEN-LAST:event_formMouseClicked

    private void signOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_signOutActionPerformed
        //migrated to AuthManager
    }//GEN-LAST:event_signOutActionPerformed

    private void groupComboItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_groupComboItemStateChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_groupComboItemStateChanged
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox courseCombo;
    private javax.swing.JComboBox groupCombo;
    private javax.swing.JLabel groupLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JProgressBar loadingProgress;
    private javax.swing.JPopupMenu popupMenu;
    private javax.swing.JMenuItem signOut;
    private javax.swing.JComboBox taskCombo;
    // End of variables declaration//GEN-END:variables
}
